<template>
  <div class="index-page">
    <pageHead title="公告"></pageHead>
    <main>
      <ul>
        <li @click="details(index)" v-for="(item, index) in items" :key="index">
          <div class="view">
            <div class="time" v-text="item.time"></div>
            <h5 v-text="item.text"></h5>
          </div>
        </li>
      </ul>
    </main>
    <pageFoot footIndex="3"></pageFoot>
  </div>
</template>

<script>
import pageFoot from '@/components/include/footer'
import pageHead from '@/components/include/header'
export default {
  components: { pageFoot, pageHead },
  data () {
    return {
      items: [
        {
          time: '2018.04.27',
          text: '新规：国家出手，低保不再养“懒汉”新规：国家出手，低保不再养“懒汉”新规：国家出手，低保不再养“懒汉”'
        }, {
          time: '2018.04.27',
          text: '新规：国家出手，低保不再养“懒汉”'
        }, {
          time: '2018.04.27',
          text: '新规：国家出手，低保不再养“懒汉”'
        }
      ]
    }
  },
  mounted: function () {},
  methods: {
    details: function (e) {
      this.$router.push({
        path: 'notice/details',
        query: { // 路由传参时push和query搭配使用 ，作用时传递参数
          id: e
        }
      })
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.index-page {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
  background: #fff;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  main {
    li {
      border-bottom: solid 0.02rem #eeeeee;
      .view {
        width: 6.9rem;
        margin-left: auto;
        margin-right: auto;
        padding-top: 0.4rem;
        height: 1.35rem;
        background: url("../include/img/select_right.png") no-repeat right
          center;
        background-size: 0.19rem 0.37rem;
        .time {
          font-size: 0.24rem;
          color: #a0a0a0;
        }
        h5 {
          font-weight: normal;
          font-size: 0.3rem;
          color: #313131;
          margin-top: 0.2rem;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
          width: 6.3rem;
        }
      }
    }
  }
}
</style>
